package tema13.ejercicio13;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class UI implements ActionListener {
	private Ej13 x;
	private static int s;

	public void actionPerformed(ActionEvent e) {
		s = x.estadoActual;
		if (s == 1) {
			x.estadoActual = 2;
			x.boton.setText("Concatenar Palabra");
			x.p1 = x.texto.getText();
			x.texto.setText("");
		} else if (s == 2) {
			x.estadoActual = 3;
			x.boton.setText("FIN");
			x.p2 = x.texto.getText();
			x.texto.setText(x.p1 + x.p2);
		}
	}

	public UI(Ej13 x) {
		super();
		this.x = x;
	}

}
